<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>卖家账户</title>
		<link rel="stylesheet" href="../css/common.css">
		<link rel="stylesheet" href="../css/page.css">
		<script src="../js/jquery-3.2.1.min.js"></script>
		<script src="../js/media.js"></script>
		<script src="../js/public.js"></script>
		<script src="../js/common.js"></script>
		<style type="text/css">
			.withdrawl {
				width: 100%;
				height: 44px;
				line-height: 44px;
				font-size: 14px;
				color: rgba(18, 18, 18, 0.90);
				text-align: left;
				padding-left: 12px;
				box-sizing: border-box;
			}
			.withdrawlEdu {
				width: 100%;
				height: 48px;
				line-height: 48px;
				font-size: 14px;
				box-sizing: border-box;
				background-color: #FFFFFF;
			}
			.Edu_left {
				float: left;
				width: 50px;
				height: 48px;
				line-height: 48px;
				font-size: 14px;
				box-sizing: border-box;
				text-align: left;
				padding-left: 12px;
			}
			.Edu_right {
				float: left;
				width: calc(100% - 50px);
				height: 48px;
				line-height: 48px;
				font-size: 12px;
				box-sizing: border-box;
				text-align: left;
				padding-left: 12px;
				color: rgba(18, 18, 18, 0.25);
				border: none;
				outline: none;
			}
			.withdrawl_sure {
				width: 100%;
				height: 48px;
				line-height: 48px;
				font-size: 16px;
				box-sizing: border-box;
				text-align: center;
				color: #FFFFFF;
				margin-top: 24px;
				border-radius: 10px;
			}
			/*	.content{
				height:36px;
				line-height: 36px;
				font-size: 16px;
				box-sizing: border-box;
				text-align: center;
				background-color: #FF0000;
				color: #FFFFFF;
				float: left;
			}*/
			.chongzhi {
				width: 1.4rem;
				border-radius: 10px;
				margin-left: 0.36rem;
			}
			.tixian {
				border-radius: 10px;
				background-color: #fa4535;
				width: 80%;
				margin: 0 auto;
			}
			.p1 {
				margin-bottom: 10px;
			}
			.recharge .box {
				height: auto;
			}
		</style>
	</head>
	<body>
		<div class="recharge bc-gray">
			<div class="box">
				<p class="tip">
					<span id="storeBalance" style="font-size: 32px;color: #E73B3B ;font-weight: bold;margin-top: 20px;"></span>
				</p>
				<p class="tip dairuzhang">
					待入账查询<span id="freezeMoneyNum"></span>
				</p>
				<ul class="ul-four flex">
					<li>
						<p class="p1">冻结款</p>
						<p class="p2"></p>
					</li>
					<li>
						<p class="p1">
							<a href="../page/Seller-order.html?tab_num=1">待付款</a>
						</p>
						<p class="p2"></p>
					</li>
					<li>
						<p class="p1">
							<a href="../page/Seller-order.html?tab_num=2">待发货</a>
						</p>
						<p class="p2"></p>
					</li>
					<li>
						<p class="p1">
							<a href="../page/Seller-order.html?tab_num=3">待收货</a>
						</p>
						<p class="p2"></p>
					</li>
				</ul>
			</div>
			<div class="withdrawl">
				提现金额
			</div>
			<div class="withdrawlEdu">
				<div class="Edu_left">金额</div>
				<div class="Edu_right">
					<input type="tel" style="border: none" placeholder="请填写提现金额" id="txje">
				</div>
			</div>
			<div class="withdrawl_sure">
				<!--<div class="content chongzhi">充值</div>       -->
				<div class="content tixian" id="txmoney">提现</div>
			</div>
		</div>
	</body>
	<script>
		$(function() {
			$.ajax({
				url: base_url + 'ZITAOHUI/user/account',
				data: {
					userId: sessionStorage.getItem("uid"),
					type: 2
				},
				success: function(data) {
					console.log(data.extend.result);
					let all_data = data.extend.result;
					$('.recharge .box h4').text(all_data.balance)
					$('.recharge .box .tip font').text(all_data.freezeMoney)
					$('.recharge .box ul li:nth-child(1) .p2').text(all_data.freezeMoneyNum)
					$('.recharge .box ul li:nth-child(2) .p2').text(all_data.pendingPay)
					$('.recharge .box ul li:nth-child(3) .p2').text(all_data.pendingReceive)
					$('.recharge .box ul li:nth-child(4) .p2').text(all_data.pendingSend)
					$("#storeBalance").text(all_data.storeBalance);
					$("#freezeMoneyNum").text('');
				}
			})
			$("#txmoney").click(function() {
				if(isNull($("#txje").val())) {
					alert("请填写提现金额");
					return false;
				}
				if($("#txje").val() < 0 || $("#txje").val() == 0) {
					alert("请填写正确的提现金额");
					return false;
				}
				//alert('提现功能正在维护中，请稍等……')
				$.ajax({
					url: base_url + "ZITAOHUI/wexintixian",
					type: "post",
					data: {
						userId: sessionStorage.getItem("uid"),
						amount: $("#txje").val()
					},
					dataType: "json",
					success: function(data) {
						console.log(data);
						if(data.code == 1) {
							alert("提现成功");
							window.reload();
						} else {
							alert("提现失败");
						}
					}
				})
			})
			$('.dairuzhang').click(function(){
				window.location.href = "./dairuzhang.html" ;
			})
		})
	</script>
</html>